<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> 
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib tagdir="/WEB-INF/tags" prefix="tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>无标题文档</title>
	<link href="/res/css/style.css" rel="stylesheet" type="text/css" />
	<link href="/res/js/lib/layer/skin/layer.css" rel="stylesheet" type="text/css" />
	<link href="/res/js/lib/layer/skin/layer.ext.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="/res/js/jquery.js"></script>
	<script type="text/javascript" src="/res/js/lib/json2.js"></script>	
	<script type="text/javascript" src="/res/js/lib/layer/layer.js"></script>
	<script type="text/javascript" src="/res/js/common/msgTools.js"></script>	
	<script language="javascript" type="text/javascript" src="/res/js/lib/datePicker/WdatePicker.js"></script>	
	<script type="text/javascript" src="/res/js/pages/user/userList.js"></script>
</head>
<body>
	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="#">首页</a></li>
    <li><a href="#">用户管理</a></li>
    <li><a href="#">${!QUERY?"会员列表":"会员查询"}</a></li>
    </ul>
    </div>
    
    <div class="rightinfo">
    <c:if test='${!QUERY}'>
    <div class="tools">    
    	<ul class="toolbar">
	        <li id="btnAdd"><span><img src="/res/images/t01.png" /></span>添加</li>
	        <li id="btnEdit"><span><img src="/res/images/t02.png" /></span>修改</li>
	        <li id="btnDisable"><span><img src="/res/images/t03.png" /></span>禁用</li>
	        <li id="btnEnable"><span><img src="/res/images/t04.png" /></span>启用</li>
	        <li onclick="selDateRange()"><span><img src="/res/images/f05.png" /></span>导出</li>
	        <!-- <li id="btnEdit"><span><img src="/res/images/t04.png" /></span>统计</li> -->
        </ul>    
    </div>
    </c:if>
    <form id="exportForm" action="/user/list/export" method="post">
       <input type="hidden" name="createTime"/>
       <input type="hidden" name="createTime1"/>    
    </form>    
   <form id="queryForm" action='/user/list${!QUERY?"":"?__query__"}' method="post"> 
    <div class="tools" style="margin:3px 0px;background: #efefef;padding:6px 0px;">
        <span class="toolbar" style="margin-left:10px;">
		   会员id：<input name="id" value="${dto.id}" type="text" class="dfinput" style="width:60px;"/>
		   等级：
 			   <select class="dfinput"  name="level" style="width:100px;" onchange="submit()">
 			    <option value="-1" ${!empty(dto) && dto.level=="-1"?"selected":""}>---全部---</option>
				<option value="comm" ${!empty(dto) && dto.level=="comm"?"selected":""}>普通会员</option>
				<option value="vip" ${!empty(dto) && dto.level=="vip"?"selected":""}>vip会员</option>
				<option value="gold" ${!empty(dto) && dto.level=="gold"?"selected":""}>金钻会员</option>
			   </select>  
                       用户名：<input name="name" value="${dto.name}" type="text" class="dfinput" style="width:100px;"/>
                       姓名：<input name="realName" value="${dto.realName}" type="text" class="dfinput" style="width:100px;"/>
                       手机号：<input name="mobile" value="${dto.mobile}" type="text" class="dfinput" style="width:100px;"/>
                       注册时间：<input id="d12" name="createTime" value="${dto.createTime}" type="text" class="dfinput" style="width:100px;" onClick="WdatePicker()"/>
              <img onclick="WdatePicker({el:'d12'})" src="/res/js/lib/datePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">至
              <input id="d13" name="createTime1" value="${dto.createTime1}" type="text" class="dfinput" style="width:100px;" onClick="WdatePicker()"/>
              <img onclick="WdatePicker({el:'d13'})" src="/res/js/lib/datePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">             
        </span>
	    <ul class="toolbar" style="margin-left:20px;">
	        <li onclick="$('#queryForm').submit()"><span><img src="/res/images/ico06.png" /></span>搜索</li>
        </ul> 
   </div> 
   
    <table class="tablelist">
    	<thead>
	    	<tr>
	        <th width="30" class="chk"><input id="chkAll" type="checkbox" value="" /></th>
	        <th width="36">编号</th>
	        <!-- <th width="70">头像</th> -->
	        <th width="80">用户名</th>
	        <th width="80">真实姓名</th>
	        <th width="50">性别</th>
	        <th>推荐人</th>
	        <th>手机号</th>
	        <th>用户级别</th>
	        <th>登录ip</th>
	        <th>是否商户</th>
	        <th>注册时间</th>
	        <th>状态</th>
	        <th>设备类型</th>
	        <th>操作</th>
	        </tr>
        </thead>
        <tbody>        
	        <c:forEach items="${list}" var="row" varStatus="status">
		        <tr>
		        <td align="center"><input id="chk_${row.id}" type="checkbox" value="${row.id}" /></td>
		        <td>${status.index+1}</td>
<%-- 		        <td>
		            <c:if test="${empty(user.headImg)}">
		              <img src="/res/images/headimg.jpg" width="50" height="50" />
		            </c:if>
		            <c:if test="${!empty(user.headImg)}">
		              <img src="${row.head_img}" width="50" height="50"/>
		            </c:if>		        
		        </td> --%>
		        <td>${row.name}</td>
		        <td>${row.real_name}</td>
		        <td>${(!empty(row.sex)&&fn:toUpperCase(row.sex)=="F")?"女":"男"}</td>
		        <td><a href="javascript:view('${row.pid}')" class="tablelink">${row.pname}</a></td>
		        <td>${row.mobile}</td>
		        <td>
		            <c:choose>
		               <c:when test='${row.level=="comm"}'>普通会员</c:when>
		               <c:when test='${row.level=="vip"}'>VIP会员</c:when>
		               <c:when test='${row.level=="gold"}'>金钻会员</c:when>
		            </c:choose><br/>
		            <c:choose>
		               <c:when test='${row.partner_level=="1"}'>全国合伙人</c:when>
		               <c:when test='${row.partner_level=="2"}'>省级合伙人</c:when>
		               <c:when test='${row.partner_level=="3"}'>市级合伙人</c:when>
		               <c:when test='${row.partner_level=="4"}'>县级合伙人</c:when>
		            </c:choose>		            
		        </td>		        
		        <td>${row.ip}</td>
		        <td>${row.is_merchant==1?"是":"否"}</td>
		        <td><fmt:formatDate value="${row.create_time}" pattern="yyyy-MM-dd HH:mm"/> </td>		
		        <td>
		           <a href="javascript:enableUser('${row.id}','${row.is_effect==1?"0":"1"}')">
		               ${row.is_effect==1?"有效":"<font class='red'>无效</font>"}
		           </a>
		        </td>
		        <td>${row.device_type}</td>       
		        <td>
		            <a href="javascript:view('${row.id}')" class="tablelink">查看</a> 
		            <c:if test='${!QUERY}'>
		              <a href="javascript:edit('${row.id}')" class="tablelink">修改</a>     
		              <a href="javascript:deleteUser('${row.id}')" class="tablelink hide">删除</a> 
		            </c:if>
		            <a href="javascript:feedBack('${row.mobile}')" class="tablelink">客服</a> 
		        </td>
		        </tr> 
	        </c:forEach>
         </tbody>
    </table>   
    </form>
      
    <tags:pager pagerRange="10" pageSize="${pager.pageSize}" totalPage="${pager.pageCount}" curIndex="${pager.pageIndex}" rowCount="${pager.rowCount}" formId="queryForm"></tags:pager> 
 
    
    </div>
    
    <script type="text/javascript">
	   $('.tablelist tbody tr:odd').addClass('odd');
	</script>

</body>

</html>
